<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/templates/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{sysAppCompBean.id}"/>
		<f:event type="preRenderView" listener="#{sysAppCompBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Sys App Comp"/>

	<ui:define name="header">
		Sys App Comp
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty sysAppCompBean.id}">
				Edit existing Sys App Comp
			</c:when>
			<c:otherwise>
				Create a new Sys App Comp
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="sysAppCompBeanSysAppCompAppCompNo" value="App Comp No:"/>
				<h:panelGroup>
					<h:inputText id="sysAppCompBeanSysAppCompAppCompNo" required="true" value="#{sysAppCompBean.sysAppComp.appCompNo}"/>
					<h:message for="sysAppCompBeanSysAppCompAppCompNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="sysAppCompBeanSysAppCompAppCompSeqCode" value="App Comp Seq Code:"/>
				<h:panelGroup>
					<h:inputText id="sysAppCompBeanSysAppCompAppCompSeqCode" maxLength="50" value="#{sysAppCompBean.sysAppComp.appCompSeqCode}"/>
					<h:message for="sysAppCompBeanSysAppCompAppCompSeqCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysAppCompBeanSysAppCompAppCompCode" value="App Comp Code:"/>
				<h:panelGroup>
					<h:inputText id="sysAppCompBeanSysAppCompAppCompCode" maxLength="50" value="#{sysAppCompBean.sysAppComp.appCompCode}"/>
					<h:message for="sysAppCompBeanSysAppCompAppCompCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysAppCompBeanSysAppCompAppCompTypeNo" value="App Comp Type No:"/>
				<h:panelGroup>
					<h:inputText id="sysAppCompBeanSysAppCompAppCompTypeNo" value="#{sysAppCompBean.sysAppComp.appCompTypeNo}"/>
					<h:message for="sysAppCompBeanSysAppCompAppCompTypeNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysAppCompBeanSysAppCompAppCompName" value="App Comp Name:"/>
				<h:panelGroup>
					<h:inputText id="sysAppCompBeanSysAppCompAppCompName" maxLength="200" value="#{sysAppCompBean.sysAppComp.appCompName}"/>
					<h:message for="sysAppCompBeanSysAppCompAppCompName" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysAppCompBeanSysAppCompSysUserAppCompPrivileges" value="Sys User App Comp Privileges:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysAppCompBean.sysAppComp.sysUserAppCompPrivileges}"/>
					<h:dataTable id="sysAppCompBeanSysAppCompSysUserAppCompPrivileges" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sys User Login"/>
							</f:facet>
							<h:link outcome="/form/sysUserAppCompPrivilege/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="forgeviewdisplayitemSysUserLogin" value="#{forgeview:display(_item.sysUserLogin)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{sysUserLoginBean.converter}" id="sysUserAppCompPrivilegeBeanAddSysUserLogin" value="#{sysUserAppCompPrivilegeBean.add.sysUserLogin}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysUserLoginBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="sysUserAppCompPrivilegeBeanAddSysUserLogin" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Allow View"/>
							</f:facet>
							<h:link outcome="/form/sysUserAppCompPrivilege/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemAllowView" value="#{_item.allowView}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserAppCompPrivilegeBeanAddAllowView" value="#{sysUserAppCompPrivilegeBean.add.allowView}"/>
								<h:message for="sysUserAppCompPrivilegeBeanAddAllowView" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Allow Edit"/>
							</f:facet>
							<h:link outcome="/form/sysUserAppCompPrivilege/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemAllowEdit" value="#{_item.allowEdit}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserAppCompPrivilegeBeanAddAllowEdit" value="#{sysUserAppCompPrivilegeBean.add.allowEdit}"/>
								<h:message for="sysUserAppCompPrivilegeBeanAddAllowEdit" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Allow Add"/>
							</f:facet>
							<h:link outcome="/form/sysUserAppCompPrivilege/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemAllowAdd" value="#{_item.allowAdd}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserAppCompPrivilegeBeanAddAllowAdd" value="#{sysUserAppCompPrivilegeBean.add.allowAdd}"/>
								<h:message for="sysUserAppCompPrivilegeBeanAddAllowAdd" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Allow Delete"/>
							</f:facet>
							<h:link outcome="/form/sysUserAppCompPrivilege/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemAllowDelete" value="#{_item.allowDelete}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserAppCompPrivilegeBeanAddAllowDelete" value="#{sysUserAppCompPrivilegeBean.add.allowDelete}"/>
								<h:message for="sysUserAppCompPrivilegeBeanAddAllowDelete" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(sysUserAppCompPrivilegeBean.added)}" id="sysAppCompBeanSysAppCompSysUserAppCompPrivilegesAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{sysUserAppCompPrivilegeBean.add.sysAppComp}" value="#{sysAppCompBean.sysAppComp}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{sysAppCompBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty sysAppCompBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{sysAppCompBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{sysAppCompBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>